#include <iostream>
using namespace std;

bool issamechar(const char *s1, const char *s2)
{
	int len1=strlen(s1);
	int len2=strlen(s2);
	const char *t_s1=s1;
	const char *t_s2=s2;
	int countone[256]={0};
	int counttwo[256]={0};
	bool flag=true;
	while(*t_s1!='\0')
	{
		countone[*(t_s1++)]=1;
	}
	while(*t_s2!='\0')
	{
		counttwo[*(t_s2++)]=1;
	}
	for (int i=0;i<256;i++)
	{
		if (countone[i]!=counttwo[i])
		{
			flag=false;
			break;
		}
	}
	return flag;

}


int main()
{
	char *s="abcdefg";
	char *s1="bdacfegh";
	bool flag=issamechar(s,s1);
	cout<<flag<<endl;
	return 0;

}